﻿@using JESAI.HttpRequestMonitor.Core.Abstracts
@{
    Layout = "~/Views/HttpRequestMonitor/HttpRequestMonitorTemplate.cshtml";

    var RequestInfo = ViewBag.Info as IRequestModel;

    var RequestDetail = ViewBag.Detail as IRequestDetailModel;

    var lang = ViewBag.Language as JESAI.HttpRequestMonitor.Dashboard.Services.Language.ILanguage;

}

    <style type="text/css">

        .table td, th {
            text-align: center;
            line-height: 24px !important;
            font-size:12px;
        }
    </style>

    <div class="panel panel-default">

        <div class="panel-body" style="padding-left:30px;padding-right:30px;padding-top:30px;padding-bottom:30px">

            <div class="row col-sm-9">

                <div class="panel panel-default">

                    <div class="panel-body" style="padding-bottom:20px">

                        @if (RequestInfo == null || RequestDetail == null)
                        {
                            <h3 class="request_detail_notfound">@lang.Request_NotFound</h3>
                        }
                        else
                        {
                            <h3 class="request_detail_title" style="padding-left:6px;margin-bottom:30px"><i class="fa fa-star-half-o" style="margin-right:10px"></i>  请求基础信息</h3>

                            <table class="table table-striped table-bordered">
                                <thead>
                                    <tr>
                                        <th width="160">Key</th>
                                        <th>Value</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>RequestId</td>
                                        <td style="text-align:left;font-size:12px;padding-left:8px">@RequestInfo.Id</td>
                                    </tr>
                                    <tr>
                                        <td>@lang.Index_ServiceNode</td>
                                        <td style="text-align:left;font-size:12px;padding-left:8px">@RequestInfo.Node</td>
                                    </tr>
                                    <tr>
                                        <td>@lang.Request_Route</td>
                                        <td style="text-align:left;font-size:12px;padding-left:8px">@RequestInfo.Route</td>
                                    </tr>

                                    <tr>
                                        <td>@lang.Request_Url</td>
                                        <td style="text-align:left;font-size:12px;padding-left:8px">@RequestInfo.Url</td>
                                    </tr>

                                    <tr>
                                        <td>@lang.Request_Type</td>
                                        <td style="text-align:left;font-size:12px;padding-left:8px">@RequestInfo.Method</td>
                                    </tr>

                                    <tr>
                                        <td>@lang.Request_Time</td>
                                        <td style="text-align:left;font-size:12px;padding-left:8px">@RequestInfo.Milliseconds</td>
                                    </tr>

                                    <tr>
                                        <td>@lang.Request_StatusCode</td>
                                        <td style="text-align:left;font-size:12px;padding-left:6px">@RequestInfo.StatusCode</td>
                                    </tr>

                                    <tr>
                                        <td>@lang.Request_RemoteIP</td>
                                        <td style="text-align:left;font-size:12px;padding-left:6px">@RequestInfo.IP</td>
                                    </tr>

                                    <tr>
                                        <td>@lang.Request_CreateTime</td>
                                        <td style="text-align:left;font-size:12px;padding-left:6px">@RequestInfo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss fff")</td>
                                    </tr>


                                </tbody>
                            </table>

                            <h3 class="request_detail_title" style="padding-left:6px; margin-top:50px;margin-bottom:30px"><i class="fa fa-space-shuttle" style="margin-right:10px"></i>  请求详细信息</h3>

                            <table class="table table-striped table-bordered">
                                <thead>
                                    <tr>
                                        <th width="160">Key</th>
                                        <th>Value</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>QueryString</td>
                                        <td style="text-align:left;font-size:12px">@RequestDetail.QueryString</td>
                                    </tr>

                                    <tr>
                                        <td>Header</td>
                                        <td style="text-align:left;font-size:12px">@RequestDetail.RequestHeader</td>
                                    </tr>

                                    <tr>
                                        <td>Cookie</td>
                                        <td style="text-align:left;font-size:12px">@RequestDetail.Cookie</td>
                                    </tr>

                                    <tr>
                                        <td>RequestBody</td>
                                        <td style="text-align:left;font-size:12px">@RequestDetail.RequestBody</td>
                                    </tr>


                                    <tr>
                                        <td>ResponseBody</td>
                                        <td style="text-align:left;font-size:12px">@RequestDetail.ResponseBody</td>
                                    </tr>

                                    <tr>
                                        <td>Error</td>
                                        <td style="text-align:left;font-size:12px">@RequestDetail.ErrorMessage</td>
                                    </tr>

                                    <tr>
                                        <td>ErrorStack</td>
                                        <td style="text-align:left;font-size:12px">@RequestDetail.ErrorStackTrace</td>
                                    </tr>


                                </tbody>
                            </table> 
                            
                        }


                    </div>

                </div>

            </div>


        </div>  

    </div>  


    <script src="/HttpRequestMonitorStaticFiles/Content/page/requestinfo_detail.js?ver=1.0.4"></script>
